package com.iot.device.service.impl;

import java.util.List;
import com.iot.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.PressureSensorAlarmDeviceMapper;
import com.iot.device.domain.PressureSensorAlarmDevice;
import com.iot.device.service.IPressureSensorAlarmDeviceService;

/**
 * 压力报警灯Service业务层处理
 *
 * @author iot
 * @date 2023-08-07
 */
@Service
public class PressureSensorAlarmDeviceServiceImpl implements IPressureSensorAlarmDeviceService
{
    @Autowired
    private PressureSensorAlarmDeviceMapper pressureSensorAlarmDeviceMapper;

    /**
     * 查询压力报警灯
     *
     * @param id 压力报警灯主键
     * @return 压力报警灯
     */
    @Override
    public PressureSensorAlarmDevice selectPressureSensorAlarmDeviceById(Long id)
    {
        return pressureSensorAlarmDeviceMapper.selectPressureSensorAlarmDeviceById(id);
    }

    /**
     * 查询压力报警灯列表
     *
     * @param pressureSensorAlarmDevice 压力报警灯
     * @return 压力报警灯
     */
    @Override
    public List<PressureSensorAlarmDevice> selectPressureSensorAlarmDeviceList(PressureSensorAlarmDevice pressureSensorAlarmDevice)
    {
        return pressureSensorAlarmDeviceMapper.selectPressureSensorAlarmDeviceList(pressureSensorAlarmDevice);
    }

    /**
     * 新增压力报警灯
     *
     * @param pressureSensorAlarmDevice 压力报警灯
     * @return 结果
     */
    @Override
    public int insertPressureSensorAlarmDevice(PressureSensorAlarmDevice pressureSensorAlarmDevice)
    {
        pressureSensorAlarmDevice.setCreateTime(DateUtils.getNowDate());
        return pressureSensorAlarmDeviceMapper.insertPressureSensorAlarmDevice(pressureSensorAlarmDevice);
    }

    /**
     * 修改压力报警灯
     *
     * @param pressureSensorAlarmDevice 压力报警灯
     * @return 结果
     */
    @Override
    public int updatePressureSensorAlarmDevice(PressureSensorAlarmDevice pressureSensorAlarmDevice)
    {
        pressureSensorAlarmDevice.setUpdateTime(DateUtils.getNowDate());
        return pressureSensorAlarmDeviceMapper.updatePressureSensorAlarmDevice(pressureSensorAlarmDevice);
    }

    /**
     * 批量删除压力报警灯
     *
     * @param ids 需要删除的压力报警灯主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorAlarmDeviceByIds(Long[] ids)
    {
        return pressureSensorAlarmDeviceMapper.deletePressureSensorAlarmDeviceByIds(ids);
    }

    /**
     * 删除压力报警灯信息
     *
     * @param id 压力报警灯主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorAlarmDeviceById(Long id)
    {
        return pressureSensorAlarmDeviceMapper.deletePressureSensorAlarmDeviceById(id);
    }
}
